package com.jic.veteran.portal.service.impl;

import com.jic.veteran.mapper.ProjectThanksMapper;
import com.jic.veteran.model.ProjectThanks;
import com.jic.veteran.model.ProjectThanksExample;
import com.jic.veteran.portal.service.ProjectThanksService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class ProjectThanksServiceImpl implements ProjectThanksService {
    @Autowired
    private ProjectThanksMapper projectThanksMapper;
    @Override
    public ProjectThanks getItem(String projectId) {
        ProjectThanksExample projectThanksExample = new ProjectThanksExample();
        projectThanksExample.createCriteria().andProjectIdEqualTo(projectId);
        List<ProjectThanks> projectThanksList = projectThanksMapper.selectByExample(projectThanksExample);
        if(!projectThanksList.isEmpty()) {
           return projectThanksList.get(0);
        }
        return null;
    }
}
